package com.android.marble;

import com.stickycoding.rokon.Modifier;
import com.stickycoding.rokon.Sprite;

public class ColorModifier extends Modifier {
        public float color;
        @Override
        public void onStart(Sprite sprite) {
                color = 1;
        }
        @Override
        public void onUpdate(Sprite sprite) {
                // Here you can do anything to the sprite, like move it or whatever.
                // But we will just do a simple color modification
            
                sprite.setRGB(1, color, color);
                color -= 0.01;
                // When the sprite's original colors has been restored, end it.
                if (color <= 0)
                {
                    sprite.setRGB(1, 1, 1);//end();
                    color = 1;
                }
        }
        //------end implement--------
        @Override
        public void onEnd(Sprite sprite) {
                sprite.setRGB(1, 1, 1);
        }
}